﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Net.Chirash.Twitter.TwitterClient;
using Net.Chirash.Twitter.TwitterDatabase;

namespace Net.Chirash.Twitter.TweetZone.WindowComponents.MiniControls
{
	/// <summary>
	/// StatusOperationPanel.xaml の相互作用ロジック
	/// </summary>
	public partial class StatusOperationPanel : UserControl
    {
        #region Constructor

        public StatusOperationPanel()
		{
			InitializeComponent();
		}

        #endregion

        #region Public Callbacks

        public delegate void OperationCallback();
        /// <summary>
        /// ボタンがクリックされたときに呼び出されるメソッドを呼び出すdelegateです。
        /// </summary>
        public OperationCallback Reply, Retweet, DirectMessage;

        #endregion

        #region Dependency Properties

        public static readonly DependencyProperty UserDependencyProperty
            = DependencyProperty.Register("User", typeof(User), typeof(StatusOperationPanel));
        public User User
        {
            get { return GetValue(UserDependencyProperty) as User; }
            set { SetValue(UserDependencyProperty, User); }
        }

        #endregion

        #region Private Events

        private void ReplyButton_Click(object sender, RoutedEventArgs e)
        {
            Reply();
        }

        private void RetweetButton_Click(object sender, RoutedEventArgs e)
        {
            Retweet();
        }

        private void ProfileButton_Click(object sender, RoutedEventArgs e)
        {
            new UserProfileWindow(User, true);
        }

        private void DirectMessageButton_Click(object sender, RoutedEventArgs e)
        {
            DirectMessage();
        }

        #endregion
    }
}
